// 审核状态枚举
export const STATUS_TAG: any = {
  LABEL: {
    0: '待审核',
    1: '审核通过',
    2: '已驳回',
  },
  COLOR: {
    0: 'warning',
    1: 'success',
    2: 'error',
  },
};

export function filterEmptyValues(obj: { [key: string]: any }): {
  [key: string]: any;
} {
  return Object.fromEntries(
    Object.entries(obj).filter(([key, value]) => {
      // 包含的非空值类型
      const nonEmptyTypes = [String, Number, Boolean, Array, Object];

      // 检查是否为非空值
      return (
        value !== null &&
        value !== undefined &&
        value !== '' &&
        (!Array.isArray(value) || value.length > 0) &&
        (!nonEmptyTypes.includes(typeof value) ||
          (typeof value === 'object' && !Object.keys(value).length === 0))
      );
    }),
  );
}
